import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 15})

fig, ax = plt.subplots(figsize=(15, 10))
x = [8, 32, 256, 512, 1024, 4096, 8192]

gflops_naive  = [5.120000e-01, 6.301538e-01, 3.374849e-01, 3.523043e-01, 2.318527e-01, 9.712401e-02, 8.427324e-02]
gflops_cblas  = [2.188034e-03, 3.276800e+01, 3.615779e+01, 4.039661e+01, 4.397517e+01, 3.763584e+01, 3.792938e+01]
gflops_openmp = [1.175255e-04, 1.724632e+00, 1.504346e+00, 1.535487e+00, 1.282974e+00, 2.393135e-01, 1.980965e-01]
gflops_pthread= [3.849624e-03, 2.400586e-01, 1.535461e+00, 1.556445e+00, 1.047127e+00, 2.958708e-01, 2.428564e-01]

plt.plot(x, gflops_naive, label='naive', color='blue', linestyle='-', linewidth=3.0)
plt.plot(x, gflops_cblas, label='cblas', color='green', linestyle='-.', linewidth=3.0)
plt.plot(x, gflops_openmp, label='openmp', color='purple', linestyle=':', linewidth=3.0)
plt.plot(x, gflops_pthread, label='pthread', color='red', linestyle='--', linewidth=3.0)

plt.title('dgemm')
plt.xlabel('matrix size')
plt.ylabel('gflops')
plt.legend()

# plt.savefig('result.png')
plt.show()